FernandoMarcelo.com

Geek things that i learn everyday.

Flower

Debian VE in OpenVz: FATAL: Could not load /lib/modules/2.6.26-2-openvz-amd64/modules.dep: No such file or directory

FATAL: Could not load /lib/modules/2.6.26-2-openvz-amd64/modules.dep: No such file or directory
I had this problem when running Debian on a OpenVZ VE, more exactly when trying to start APF. This problem also happens with other firewalls that use iptables.

The fix is pretty simple. On your HN, edit file /etc/vz/conf/{$VEID}.conf ( or /etc/vz/vz.conf if you want for all VE ) and add the following line:

IPTABLES=”ip_tables iptable_filter iptable_mangle ip_conntrack ip_conntrack_irc ip_conntrack_ftp ipt_state ipt_multiport ipt_limit  ipt_LOG ipt_REJECT ipt_length ipt_multiport ipt_owner ipt_state ipt_ttl ipt_TOS ipt_TCPMSS”

This should be on one line, you shouldn’t have line breaks on it. Save the file and restart the VE.

Now, enter on the VE and run:

depmod -a

If you get problems about directory /lib/modules/2.6.26-2-openvz-amd64/ missing, just create it with:

mkdir /lib/modules/2.6.26-2-openvz-amd64/

And run depmod -a again.

Done, you should not get more iptables problems.

One Response to “Debian VE in OpenVz: FATAL: Could not load /lib/modules/2.6.26-2-openvz-amd64/modules.dep: No such file or directory”

  1. December 7th, 2009 at 9:35 am

    t0 says:

    You should add ipt_REDIRECT also in your line to allow port forwarding.

Leave a Reply